/*
 * =====================================================================================
 *
 *       Filename:  main.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  2014年07月18日 10时38分21秒
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jianxi sun (jianxi), ycsunjane@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef __GPS_H__
#define __GPS_H__
#include "arg.h"
#define pr_debug(...) 				\
	do { 					\
		if(args_info.debug_flag) 	\
			fprintf(stderr,__VA_ARGS__); 	\
	}while(0)

#define SPEED 		(115200)
#define BITS 		(8)
#define EVENT 		'N'
#define STOP 		(1) 
#define BUFSIZE 	(1024)

static uint8_t CHEAD[2] = {0xff, 0x55};
enum {
	CMD_FACTORY	= 0xc0,
	CMD_WRITE_COUNT	= 0xc1,
	CMD_CANCEL	= 0xc2,
	CMD_READ_COUNT	= 0xc3,
};

struct command {
	uint8_t c_head[2];
	uint8_t cmd;
	union {
		uint8_t  status;
		uint32_t count;
	};
	uint8_t crc;
} __attribute__((packed));

#endif /* _GPS_H_ */
